create table Hotel
(
	 [HotelId] int identity(1, 1) primary key
	,[PartnerId] int
	,[HotelTypeId] int
	,[HotelFullName] nvarchar(128)
	,[HotelSortName] nvarchar(128)
	,[HotelEnglishName] nvarchar(128)
	,[SortDescription] nvarchar(256)
	,[DetailDescrtiption] nvarchar(max)
	,[FloorQuantity] int
	,[ContinentId] int
	,[NationalId] int
	,[CityId] int
	,[DistrictId] int
	,[WardId] int
	,[Address] nvarchar(256)
	,[RepresentName] nvarchar(128)
	,[RepresentPhone] varchar(32)
	,[RepresentHotline] varchar(32)
	,[RepresentFax] varchar(32)
	,[RepresentEmail] varchar(64)
	,[RepresentWebsite] nvarchar(256)
	,[Utilities] varchar(128)
	,[CreatedBy] int
	,[CreatedDate] datetime
	,[UpdatedBy] int
	,[UpdatedDate] datetime
	,[Status] int
)
go

ALTER PROCEDURE HotelGet
	@HotelId int
AS
SELECT *
FROM [Hotel]
WHERE [Hotel].[HotelId] = @HotelId
GO

ALTER PROCEDURE HotelList
AS
SELECT *
FROM [Hotel]
GO

ALTER PROCEDURE HotelInsert
	 @PartnerId int
	,@HotelTypeId int
	,@HotelFullName nvarchar(128)
	,@HotelSortName nvarchar(128)
	,@HotelEnglishName nvarchar(128)
	,@SortDescription nvarchar(256)
	,@DetailDescrtiption nvarchar(max)
	,@FloorQuantity int
	,@ContinentId int
	,@NationalId int
	,@CityId int
	,@DistrictId int
	,@WardId int
	,@Address nvarchar(256)
	,@RepresentName nvarchar(128)
	,@RepresentPhone varchar(32)
	,@RepresentHotline varchar(32)
	,@RepresentFax varchar(32)
	,@RepresentEmail varchar(64)
	,@RepresentWebsite nvarchar(256)
	,@Utilities varchar(128)
	,@CreatedBy int
	,@CreatedDate datetime
	,@UpdatedBy int
	,@UpdatedDate datetime
	,@Status int
AS

INSERT INTO Hotel (
	 [PartnerId]
	,[HotelTypeId]
	,[HotelFullName]
	,[HotelSortName]
	,[HotelEnglishName]
	,[SortDescription]
	,[DetailDescrtiption]
	,[FloorQuantity]
	,[ContinentId]
	,[NationalId]
	,[CityId]
	,[DistrictId]
	,[WardId]
	,[Address]
	,[RepresentName]
	,[RepresentPhone]
	,[RepresentHotline]
	,[RepresentFax]
	,[RepresentEmail]
	,[RepresentWebsite]
	,[Utilities]
	,[CreatedBy]
	,[CreatedDate]
	,[UpdatedBy]
	,[UpdatedDate]
	,[Status]
	
) VALUES (
	 @PartnerId
	,@HotelTypeId
	,@HotelFullName
	,@HotelSortName
	,@HotelEnglishName
	,@SortDescription
	,@DetailDescrtiption
	,@FloorQuantity
	,@ContinentId
	,@NationalId
	,@CityId
	,@DistrictId
	,@WardId
	,@Address
	,@RepresentName
	,@RepresentPhone
	,@RepresentHotline
	,@RepresentFax
	,@RepresentEmail
	,@RepresentWebsite
	,@Utilities
	,@CreatedBy
	,@CreatedDate
	,@UpdatedBy
	,@UpdatedDate
	,@Status
)

select SCOPE_IDENTITY()
GO

ALTER PROCEDURE HotelUpdate
	@HotelId int, 
	@PartnerId int, 
	@HotelTypeId int, 
	@HotelFullName nvarchar(128), 
	@HotelSortName nvarchar(128), 
	@HotelEnglishName nvarchar(128), 
	@SortDescription nvarchar(256), 
	@DetailDescrtiption nvarchar(max), 
	@FloorQuantity int, 
	@ContinentId int, 
	@NationalId int, 
	@CityId int, 
	@DistrictId int, 
	@WardId int, 
	@Address nvarchar(256), 
	@RepresentName nvarchar(128), 
	@RepresentPhone varchar(32), 
	@RepresentHotline varchar(32), 
	@RepresentFax varchar(32), 
	@RepresentEmail varchar(64), 
	@RepresentWebsite nvarchar(256), 
	@Utilities varchar(128),
	@CreatedBy int, 
	@CreatedDate datetime, 
	@UpdatedBy int, 
	@UpdatedDate datetime, 
	@Status int 

AS

UPDATE Hotel SET
	    [PartnerId] = @PartnerId
	   ,[HotelTypeId] = @HotelTypeId
	   ,[HotelFullName] = @HotelFullName
	   ,[HotelSortName] = @HotelSortName
	   ,[HotelEnglishName] = @HotelEnglishName
	   ,[SortDescription] = @SortDescription
	   ,[DetailDescrtiption] = @DetailDescrtiption
	   ,[FloorQuantity] = @FloorQuantity
	   ,[ContinentId] = @ContinentId
	   ,[NationalId] = @NationalId
	   ,[CityId] = @CityId
	   ,[DistrictId] = @DistrictId
	   ,[WardId] = @WardId
	   ,[Address] = @Address
	   ,[RepresentName] = @RepresentName
	   ,[RepresentPhone] = @RepresentPhone
	   ,[RepresentHotline] = @RepresentHotline
	   ,[RepresentFax] = @RepresentFax
	   ,[RepresentEmail] = @RepresentEmail
	   ,[RepresentWebsite] = @RepresentWebsite
	   ,[Utilities] = @Utilities
	   ,[CreatedBy] = @CreatedBy
	   ,[CreatedDate] = @CreatedDate
	   ,[UpdatedBy] = @UpdatedBy
	   ,[UpdatedDate] = @UpdatedDate
	   ,[Status] = @Status
WHERE [Hotel].[HotelId] = @HotelId
GO

ALTER PROCEDURE HotelDelete
	@HotelId int
AS
DELETE FROM Hotel
WHERE [Hotel].[HotelId] = @HotelId
GO